Integrand size = 33, antiderivative size = 72 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {C x}{a^2}+\frac {(A+2 B-5 C) \sin (c+d x)}{3 a^2 d (1+\cos (c+d x))}+\frac {(A-B+C) \sin (c+d x)}{3 d (a+a \cos (c+d x))^2} \]
C*x/a^2+1/3*(A+2*B-5*C)*sin(d*x+c)/a^2/d/(1+cos(d*x+c))+1/3*(A-B+C)*sin(d* x+c)/d/(a+a*cos(d*x+c))^2
Leaf count is larger than twice the leaf count of optimal. \(175\) vs. \(2(72)=144\).
Time = 0.90 (sec) , antiderivative size = 175, normalized size of antiderivative = 2.43 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {\sec \left (\frac {c}{2}\right ) \sec ^3\left (\frac {1}{2} (c+d x)\right ) \left (9 C d x \cos \left (\frac {d x}{2}\right )+9 C d x \cos \left (c+\frac {d x}{2}\right )+3 C d x \cos \left (c+\frac {3 d x}{2}\right )+3 C d x \cos \left (2 c+\frac {3 d x}{2}\right )+6 A \sin \left (\frac {d x}{2}\right )+6 B \sin \left (\frac {d x}{2}\right )-18 C \sin \left (\frac {d x}{2}\right )-6 B \sin \left (c+\frac {d x}{2}\right )+12 C \sin \left (c+\frac {d x}{2}\right )+2 A \sin \left (c+\frac {3 d x}{2}\right )+4 B \sin \left (c+\frac {3 d x}{2}\right )-10 C \sin \left (c+\frac {3 d x}{2}\right )\right )}{24 a^2 d} \]
(Sec[c/2]*Sec[(c + d*x)/2]^3*(9*C*d*x*Cos[(d*x)/2] + 9*C*d*x*Cos[c + (d*x) /2] + 3*C*d*x*Cos[c + (3*d*x)/2] + 3*C*d*x*Cos[2*c + (3*d*x)/2] + 6*A*Sin[ (d*x)/2] + 6*B*Sin[(d*x)/2] - 18*C*Sin[(d*x)/2] - 6*B*Sin[c + (d*x)/2] + 1 2*C*Sin[c + (d*x)/2] + 2*A*Sin[c + (3*d*x)/2] + 4*B*Sin[c + (3*d*x)/2] - 1 0*C*Sin[c + (3*d*x)/2]))/(24*a^2*d)
Time = 0.44 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.04, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {3042, 3498, 25, 3042, 3214, 3042, 3127}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a \cos (c+d x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^2}dx\) |
\(\Big \downarrow \) 3498 |
\(\displaystyle \frac {(A-B+C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}-\frac {\int -\frac {a (A+2 B-2 C)+3 a C \cos (c+d x)}{\cos (c+d x) a+a}dx}{3 a^2}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \frac {a (A+2 B-2 C)+3 a C \cos (c+d x)}{\cos (c+d x) a+a}dx}{3 a^2}+\frac {(A-B+C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (A+2 B-2 C)+3 a C \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}dx}{3 a^2}+\frac {(A-B+C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {a (A+2 B-5 C) \int \frac {1}{\cos (c+d x) a+a}dx+3 C x}{3 a^2}+\frac {(A-B+C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a (A+2 B-5 C) \int \frac {1}{\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}dx+3 C x}{3 a^2}+\frac {(A-B+C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
\(\Big \downarrow \) 3127 |
\(\displaystyle \frac {\frac {a (A+2 B-5 C) \sin (c+d x)}{d (a \cos (c+d x)+a)}+3 C x}{3 a^2}+\frac {(A-B+C) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}\) |
((A - B + C)*Sin[c + d*x])/(3*d*(a + a*Cos[c + d*x])^2) + (3*C*x + (a*(A + 2*B - 5*C)*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])))/(3*a^2)
3.4.50.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b ^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*b - a* B + b*C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(a*f*(2*m + 1))), x] + Simp[1 /(a^2*(2*m + 1)) Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[a*A*(m + 1) + m*(b *B - a*C) + b*C*(2*m + 1)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && LtQ[m, -1] && EqQ[a^2 - b^2, 0]
Time = 2.08 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.74
method | result | size |
parallelrisch | \(\frac {\left (A -B +C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 A +3 B -9 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+6 d x C}{6 a^{2} d}\) | \(53\) |
risch | \(\frac {C x}{a^{2}}+\frac {2 i \left (3 B \,{\mathrm e}^{2 i \left (d x +c \right )}-6 C \,{\mathrm e}^{2 i \left (d x +c \right )}+3 A \,{\mathrm e}^{i \left (d x +c \right )}+3 B \,{\mathrm e}^{i \left (d x +c \right )}-9 C \,{\mathrm e}^{i \left (d x +c \right )}+A +2 B -5 C \right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3}}\) | \(98\) |
derivativedivides | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}-\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{3}+\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +4 C \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(99\) |
default | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}-\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{3}+\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{3}+A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +4 C \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(99\) |
norman | \(\frac {\frac {C x}{a}+\frac {C x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {2 C x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (A -B +C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}+\frac {\left (A +B -3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}+\frac {\left (5 A +B -7 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}+\frac {\left (7 A +5 B -17 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}}{a \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\) | \(166\) |
Time = 0.26 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.32 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {3 \, C d x \cos \left (d x + c\right )^{2} + 6 \, C d x \cos \left (d x + c\right ) + 3 \, C d x + {\left ({\left (A + 2 \, B - 5 \, C\right )} \cos \left (d x + c\right ) + 2 \, A + B - 4 \, C\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \]
1/3*(3*C*d*x*cos(d*x + c)^2 + 6*C*d*x*cos(d*x + c) + 3*C*d*x + ((A + 2*B - 5*C)*cos(d*x + c) + 2*A + B - 4*C)*sin(d*x + c))/(a^2*d*cos(d*x + c)^2 + 2*a^2*d*cos(d*x + c) + a^2*d)
Leaf count of result is larger than twice the leaf count of optimal. 148 vs. \(2 (70) = 140\).
Time = 0.86 (sec) , antiderivative size = 148, normalized size of antiderivative = 2.06 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\begin {cases} \frac {A \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{6 a^{2} d} + \frac {A \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a^{2} d} - \frac {B \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{6 a^{2} d} + \frac {B \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a^{2} d} + \frac {C x}{a^{2}} + \frac {C \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{6 a^{2} d} - \frac {3 C \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a^{2} d} & \text {for}\: d \neq 0 \\\frac {x \left (A + B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right )}{\left (a \cos {\left (c \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \]
Piecewise((A*tan(c/2 + d*x/2)**3/(6*a**2*d) + A*tan(c/2 + d*x/2)/(2*a**2*d ) - B*tan(c/2 + d*x/2)**3/(6*a**2*d) + B*tan(c/2 + d*x/2)/(2*a**2*d) + C*x /a**2 + C*tan(c/2 + d*x/2)**3/(6*a**2*d) - 3*C*tan(c/2 + d*x/2)/(2*a**2*d) , Ne(d, 0)), (x*(A + B*cos(c) + C*cos(c)**2)/(a*cos(c) + a)**2, True))
Leaf count of result is larger than twice the leaf count of optimal. 164 vs. \(2 (68) = 136\).
Time = 0.30 (sec) , antiderivative size = 164, normalized size of antiderivative = 2.28 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=-\frac {C {\left (\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )} - \frac {A {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2}} - \frac {B {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, d} \]
-1/6*(C*((9*sin(d*x + c)/(cos(d*x + c) + 1) - sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^2 - 12*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^2) - A*(3*sin( d*x + c)/(cos(d*x + c) + 1) + sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^2 - B *(3*sin(d*x + c)/(cos(d*x + c) + 1) - sin(d*x + c)^3/(cos(d*x + c) + 1)^3) /a^2)/d
Time = 0.32 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.61 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {\frac {6 \, {\left (d x + c\right )} C}{a^{2}} + \frac {A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \]
1/6*(6*(d*x + c)*C/a^2 + (A*a^4*tan(1/2*d*x + 1/2*c)^3 - B*a^4*tan(1/2*d*x + 1/2*c)^3 + C*a^4*tan(1/2*d*x + 1/2*c)^3 + 3*A*a^4*tan(1/2*d*x + 1/2*c) + 3*B*a^4*tan(1/2*d*x + 1/2*c) - 9*C*a^4*tan(1/2*d*x + 1/2*c))/a^6)/d
Time = 1.52 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.57 \[ \int \frac {A+B \cos (c+d x)+C \cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx=\frac {\frac {3\,A\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}+\frac {A\,\sin \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}{2}+B\,\sin \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )-\frac {3\,C\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}-\frac {5\,C\,\sin \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}{2}+\frac {9\,C\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (c+d\,x\right )}{2}+\frac {3\,C\,\cos \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )\,\left (c+d\,x\right )}{2}}{6\,a^2\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3} \]